package com.cloudkinto.service.mail;

import com.cloudkinto.entity.MailAccountDo;
import com.cloudkinto.entity.MailDo;
import com.baomidou.mybatisplus.extension.service.IService;

import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.service.consumer.vo.mail.MailOrderConsumerReq;

import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.Store;
import java.util.List;
import java.util.Map;
import java.util.Properties;

/**
 * <p>
 *  service接口
 * </p>
 * @author hua
 * @since 2025-01-10
 */
public interface MailService extends IService<MailDo> {

    int delete(Long id, Long userId);

    Object detail(Long id);

    SingleResult pageInit();

    List<Object> getList(Map<String, String> map);

    PageResult getListPage(Map<String, String> map);


    String syncMail(Long accountId, boolean autoFlag);

    void syncOneMailMsg(Message a, String type, Long accountId, String mailNo, Long storeId, Long companyId) throws Exception;

    void timingSynchronizationMail();

    void syncMailOrder(MailOrderConsumerReq req);

    Store getIMAPStore(String smtpHost, String imapHost, String mailNo, String password) throws Exception;

    Properties getSmtpProperties(String smtp, String mailNo, String password, String port);

    Authenticator getAuthenticator(Properties props);


}
